package com.kgc.xsConsumer.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.xsConsumer.feign.SalesCounterFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/counter")
@CrossOrigin
public class SalesCounterController {

    private Logger logger= LoggerFactory.getLogger(SalesCounterController.class);

    @Autowired
    private SalesCounterFeign salesCounterFeign;


    @RequestMapping("/addCode")
    public ResponseMsg addCode(@RequestBody Map<String,Object> map) {
        logger.info("SalesCounterController addCode params {} ",map.toString());
        ResponseMsg responseMsg =salesCounterFeign.addSalesCode(map);
        logger.debug("SalesCounterController addCode responseMsg {}",responseMsg.toString());

        return responseMsg;
    }

}
